Urthman's MDB Construction Kit. |
ASCII File Headers and Trailers |
What are headers and trailers, and when, if at all, should they be used.
Comma Delimited File formats:
In comma-delimited files, the header record contains the column headings for the data records that follow that header record. Generally, this file format is used to transfer files from one database or spreadsheet program to another without having to be too concerned about the sender and recipient having the same spread sheet or database program. The header information is used as column headings in a users spread sheet program, and to inform the software importing the data, where each element in each data record should go.
The code generated by the Urthman's MDB Construction Kit for exporting comma delimited files includes an option to write a header record containing the data field names. The code generated for importing comma delimited formats uses the header record to align the columns of data with the appropriate corresponding fields of the database table into which the data is being imported. This permits the following scenario:
The most significant part is that the data is imported into the correct data fields despite the fact that the columns have been moved around, and some columns may have been deleted. Columns that have been removed will result in null or default data in the record.
Fixed Length Record formats: | Schematic |
|||||
The
fixed record length file format is the predominant
practice found in the exchange of data within the
telecommunications, insurance and banking industries.
Often, file and batch headers and trailers are used for
organizing the data within the files. In fixed length record formats, header and trailer records are used for grouping detail records by a type or category The header record contains some common data element(s) shared by the enclosed detail records, while the trailer record might repeat the same data elements as the header, and also contain some summary data used to validate the integrity of the enclosed data. Fixed length record formatted files can include both a file header and trailer, as well as batch header and trailer groups. This is generally a practice used where multiple companies are sending or receiving data files between each other. The file header might contain data that identifies who the sending and receiving companies are, and the trailer record might contain a summary of the enclosed batches. |
|
The Urthman's MDB Construction Kit allows you, the programmer, to select header and trailer record layouts for any given table, and to define up to three elements for each of the headers and trailers as recognition codes. While importing data, the incoming record is tested for these recognition elements, and when encountered, the header or trailer record is broken out into it's component parts as needed. Also, during this import function, a variable (RecType) is set to indicate the record that had just been imported.
The Construction Kit also sets up the subroutines necessary for exporting these same headers and trailers. Please note that the same elements used to identify these records are included in the generated code, where the values of these elements are set just before writing the record to the file.
|
Microsoft, Windows, NT and Visual Basic are registered trademarks of the Microsoft Corporation. |